package com.yjhealth.libs.businessdemo.business;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.yjhealth.libs.businessdemo.R;
import com.yjhealth.libs.commonlib.arouter.CommonArouterGroup;
import com.yjhealth.libs.commonlib.arouter.interceptor.CommonTInterceptor;
import com.yjhealth.libs.commonlib.base.activity.BaseActivity;
import com.yjhealth.libs.commonlib.web.CommonWebActivity;
import com.yjhealth.libs.core.constants.CoreConstants;
import com.yjhealth.libs.core.utils.CoreUtils;

@Route(path = CommonArouterGroup.DEMO_TEST_ACTIVITY, extras = CommonTInterceptor.GREEN_ALL)
public class DemoTestActivity extends BaseActivity {

    private TextView tvDebug;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.businessdemo_activity_demo_test);
        initLayout();

        tvDebug = findViewById(R.id.tvDebug);
        tvDebug.setText("debug=" + String.valueOf(CoreConstants.isDebug));

        Button btn1 = findViewById(R.id.btn1);
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(DemoTestActivity.this, DemoBaseActivity.class);
                startActivity(intent);
            }
        });

        Button btn2 = findViewById(R.id.btn2);
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                CommonArouterGroup.gotoActivity(CommonArouterGroup.CHANGE_NET_ACTIVITY);
            }
        });

        Button btn3 = findViewById(R.id.btn3);
        btn3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(DemoTestActivity.this, DemoRefreshActivity.class);
                startActivity(intent);
            }
        });

        Button btn4 = findViewById(R.id.btn4);
        btn4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(DemoTestActivity.this, DemoListActivity.class);
                startActivity(intent);
            }
        });

        Button btn5 = findViewById(R.id.btn5);
        btn5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(DemoTestActivity.this, DemoFragmentActivity.class);
                startActivity(intent);
            }
        });
        Button btn6 = findViewById(R.id.btn6);
        btn6.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(DemoTestActivity.this, DemoNetActivity.class);
                startActivity(intent);
            }
        });
        Button btn7 = findViewById(R.id.btn7);
        btn7.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                CoreUtils.setDebugVerse();
            }
        });
        Button btn8 = findViewById(R.id.btn8);
        btn8.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(DemoTestActivity.this, DemoPayActivity.class);
                startActivity(intent);
            }
        });

        Button btn9 = findViewById(R.id.btn9);
        btn9.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(DemoTestActivity.this, DemoDatePickerActivity.class);
                startActivity(intent);
            }
        });

        findViewById(R.id.btn10).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(DemoTestActivity.this, DemoPermissionActivity.class);
                startActivity(intent);
            }
        });

        findViewById(R.id.btn11).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //CommonWebActivity.appStart("http://app.dev.aijk.net/index.html"+ CommonWebActivity.getCommonParam(false));
                CommonWebActivity.appStart("http://szmb.test.aijk.net/index.html#/user/myInquiry?app=android&v=25&mobile=18668077470&bCode=hcn.shenzhenchroniccenter.patient_android&token=b0c085d7-c94d-483c-aa7f-4cab22577430");
            }
        });

        findViewById(R.id.btn12).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(DemoTestActivity.this, DemoWebFragmentActivity.class);
                startActivity(intent);
            }
        });
        findViewById(R.id.btn13).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(DemoTestActivity.this, DemoButtonActivity.class);
                startActivity(intent);
            }
        });
        findViewById(R.id.btn14).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(DemoTestActivity.this, DemoViewPagerActivity.class);
                intent.putExtra("position", 1);
                startActivity(intent);
            }
        });

        findViewById(R.id.btn15).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(DemoTestActivity.this, DemoSwitchBtnActivity.class);
                startActivity(intent);
            }
        });
        findViewById(R.id.btn16).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                LocationActivity.appStart(activity);
            }
        });
    }

    @Override
    protected void onRefreshView() {

    }
}
